public class User {
    private String account;
    private String password;
    private String email;

    public User(String account, String password, String email) {
        this.account = account;
        this.password = password;
        this.email = email;
    }

    public User(String account, String password) {
        this(account, password, "");
    }

    public void showUserInfo() {
        System.out.println("账号: " + account);
        System.out.println("密码: " + password);
        if (email!= null &&!email.isEmpty()) {
            System.out.println("邮箱: " + email);
        }
    }

    public static void main(String[] args) {
        User user1 = new User("aaa", "123456", "aaa@qq.com");
        User user2 = new User("bbb", "abcdef");

        System.out.println("用户1信息如下:");
        user1.showUserInfo();
        System.out.println();
        System.out.println("用户2信息如下:");
        user2.showUserInfo();
    }
}
